<template>
  <div :class="[$style.container]">
    <div :class="[$style.body]">
      <div :class="[$style.box]">
        <component :is="component" :step-data="stepData"></component>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { Component, Prop, Provide, Vue } from 'vue-property-decorator'
import Step1 from './components/step1/index.vue'
import Step2 from './components/step2/index.vue'
import Step3 from './components/step3/index.vue'

@Component({
  components: { Step1, Step2, Step3 }
})
export default class ForgetPassword extends Vue {
  @Prop() identifier!: string

  stepData = {
    step: 1,
    identifier: this.identifier || '',
    type: 'phone',
    code: ''
  }

  get component () {
    return `step${this.stepData.step}`
  }
}
</script>

<style lang="scss" module>
@import "~@/styles/vars.scss";

$header-height: 48px;

.container {
  background-color: $bg-body-color;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.body {
  flex: 1 1 auto;
}

.box {
  background-color: $bg-color;
  padding: 32px 32px;
  border-radius: 4px;
  border: 1px solid $border-color;
  box-shadow: 0px 0px 6px rgb(0 0 0 / 10%);
  width: 360px;
  margin: 10vh auto auto auto;
}
</style>
